#pragma once
#include "ruler.h"
#include "ToolView.h"
#include "mainfrm.h"
#include "ViewInfor.h"
#include "ViewButton.h"
#include "ViewCapture.h"
#include "SplitterWndEx.h"

#include "XSplitterWnd.h"
#include "ViewMainStatic.h"

#include "HubAutoCapture.h"

#define WM_USER_HUBMSG           WM_USER + 0x200
#define USER_HUBMSG_CapStarted   0x01
#define USER_HUBMSG_CapFinished  0x02


class CMainWindow :	public CMainFrame
{
public:
	CMainWindow(void);
	~CMainWindow(void);
	
public:	
	void	SetStatusZoomFacter(float fZoomFacter);
	void	SetStatusLength(float fLength);
	void	SetStatusArea(float fArea);
	void	SetGayValue(int x,int y,DWORD dwGray);
	void	SetStatusWorkMode();
	void	SetStatusTechnics(zkCameraParam xCam);
	void	SetStatusFileTitle(char *pFileTitle);
public:
	void InitWindowFinished();
	void UnInitialize();
	BOOL m_bInit ;
	char m_szLastFileTitle[128];

public:	
	CSplitterWndExx		m_wndSplitter;
	CSplitterWndExx		m_wndSplitter2;

	CSplitterWndExx     m_wndSplitter3;
	CRulerSplitterWnd   m_DynamicRulers; 
	CRulerSplitterWnd   m_StaticRulers ;

	CViewInfor*			m_pViewInfo		;
	
	CViewCapture*       m_pViewDynamic  ;
	CViewMainStatic*    m_pViewStatic   ;

public:
	HubAutoCapture     m_xHubAutoCapture;


public:
	void ShowToolView(BOOL bShow = TRUE);

public:
	void SetShowMode(int nMode = eShowDynamic);
	void ShowPanelView();

public:
	int StartCapture();
	void RedrawCapture(int nMode);

public:
	void ResetSysParameter();


public:
	int AutoNameSaveFile(BOOL bSave = TRUE);


public:
	CStatusBar  m_wndStatusBar;

protected:
	virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//	virtual BOOL PreTranslateMessage(MSG* pMsg);
public:
	DECLARE_MESSAGE_MAP()
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

};
